#ifndef __CURRENT_SENSE_H
#define __CURRENT_SENSE_H

#include "at32f413_board.h"
#include "math_utils.h"
#include "motor.h"
#include "debug_serial.h"

#include "arm_math.h"

typedef enum
{
  NOT_STARTED = 0,
  OPENLOOP,
  VELOCITY,
  ANGLE,
  CURRENT,
  CONTROLMODE_MAX
} ControlMode_t;

void LowSideCurrentSense_InitAdc(void);
void LowSideCurrentSense_Init(void);
void LowSideCurrentSense_CalibrateOffsets(void);
PhaseCurrent_t LowSideCurrentSense_GetPhaseCurrents(void);

DqCurrent_t getFOCCurrents(float angle_el);

#endif // __CURRENT_SENSE_H
